Skip to main content

SetPosition

Specifies the amount by which text is raised or lowered for the current Range in relation to the default baseline of the surrounding non-positioned text.

Syntax

expression.SetPosition(nPosition);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nPositionRequiredhpsSpecifies a positive (raised text) or negative (lowered text) measurement in half-points (1/144 of an inch).

Returns

ApiRange | null

Example

This example specifies the amount by which text is raised or lowered for the Range in relation to the default baseline of the surrounding non-positioned text.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text. ");
paragraph.AddText("This is a text run with the text raised 5 points (10 half-points).");
let range = doc.GetRange(22, 75);
range.SetPosition(10);